package com.zy.qudadid.ui.widget;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.bigkoo.convenientbanner.holder.Holder;
import com.bumptech.glide.Glide;
import com.zy.lcpassenger.R;
import com.zy.qudadid.network.Const;

/**
 * Created by ninos on 2017/3/14.
 */

public class LocalImageHolderView implements Holder<String> {
    private ImageView imageView;
    @Override
    public View createView(Context context) {
        imageView = new ImageView(context);
        imageView.setScaleType(ImageView.ScaleType.FIT_XY);
        return imageView;
    }

    @Override
    public void UpdateUI(Context context, final int position, String data) {
        Glide.with(context)
                .load(Const.BASE_IMG+data)
                .fitCenter()
                .crossFade()
                .placeholder(R.mipmap.logo)
                .into(imageView);
    }
}
